<?php
include_once IR."functions/user/reg.func.php"; 
include_once IR."config/define/define.wordslength.php";
include_once IR."config/define/define.reg.php";

$json_rst = array('rstno'=>1,'error'=>'error','url'=>'');
$uuid = $_GET['uuid'];

if ($config_open_reg==0){
    $json_rst['rstno'] = -1;
    $json_rst['error'] = _('本服务器已经关闭注册');
    return;
}

//测试接口无用户名等校验

$u_account = user_get_user_account_by_uuid($uuid);
if (empty($u_account)){
    //创建匿名账户
    $u_account = user_reg_anonymous_user($uuid);
}

//登陆逻辑
$uid = $u_account['uid'];
 
$ts = time();
$authkey = md5( $pp_uid . md5($ts. $public_key.md5( $sys_id)));

$sid = gen_session_id($uid,$zeit,$public_key);

$online_id = gen_online_id($uid,$sid,$zeit,$uuid);
set_cookie($uid, $sid, $uid,$pp_uid,$online_id); 
init_user_session_and_cache($uid,$sid);	

$url  = './test.php';
$json_rst['url'] = $url;
 
?>
